<?php 
if (!empty($this->flash_messages))
{
    foreach ($this->flash_messages as $flash_message)
    {
        echo '<div class="message">'.$flash_message.'</div>';
    }
}
?>

<?php if (!empty($this->node)) : ?>
<div class="node-item node-view">
    <?php if (Zend_Registry::get('user')->canManage()) : ?>
    <div class="node-links">
        <a href="<?php echo $this->fixUrl('node/edit/'.$this->node->id) ?>"><?php echo Zend_Registry::get('locale')->_('Edit') ?></a>
        &nbsp;|&nbsp;
        <a class="delete" href="javascript:if(confirm('<?php echo Zend_Registry::get('locale')->_('Are you sure ?')?>')){window.location.href='<?php echo $this->fixUrl('node/delete/'.$this->node->id) ?>'}"><?php echo Zend_Registry::get('locale')->_('Delete') ?></a>
    </div>
    <?php endif; ?>
    <h1><?php echo htmlspecialchars($this->title) ?></h1>
    <p><?php echo $this->node ?></p>
    <em class="date">
        <?php echo Zend_Registry::get('locale')->_('Date').': '?>
        <?php echo date('d.m.Y',strtotime($this->publish_date)) ?>
    </em>
    <div class="node-author">
        <?php echo Zend_Registry::get('locale')->_('Author').': '?>
        <?php if (Zend_Registry::get('user')->canView(new Application_Model_UserResources(Application_Model_User::RESOURCE_NAME))) : ?>
            <a href="<?php echo $this->fixUrl('user/view/'.$this->node->uid) ?>"><?php echo $this->author ?></a>
        <?php else : ?>
            <span><?php echo $this->author ?></span>
        <?php endif; ?>
    </div>
</div>
<?php endif; ?>
